
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/parkTemplate.xhtml"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:p="http://primefaces.org/ui">
    <ui:param name="tab" value="offer"/>
    <ui:define name="title">
  #{bundle['offer.title']}
    </ui:define>
    <ui:define name="tab-content">
        <h2>#{bundle['offer.header']}</h2>
        <h:form id="form">
            <p:dataTable id="offersTable" var="cars" value="#{tarrifsParks.carTypes}" styleClass="topComponent">

                <f:facet name="header">
             #{bundle['offer.tableHeader']}
                </f:facet>

                <p:columnGroup type="header">
                    <p:row>
                        <p:column rowspan="2" headerText="#{bundle['offer.forCarType']}" styleClass="tableText" />
                        <p:column colspan="3" headerText="#{bundle['offer.tarrif']}" styleClass="tableText" />
                    </p:row>

                    <p:row>

                        <p:column headerText="#{bundle['offer.rank']}" styleClass="tableText" />
                        <p:column headerText="#{bundle['offer.durationTime']}" styleClass="tableText" />
                        <p:column headerText="#{bundle['offer.comments']}" styleClass="tableText" />
                    </p:row>
                </p:columnGroup>

                <p:subTable var="tarrif" value="#{tarrifsParks.getTarrifsFilter(cars)}">
                    <f:facet name="header">
                        #{cars}
                    </f:facet>

                    <p:column>
                        #{tarrif.name}
                    </p:column>

                    <p:column>
                        #{tarrif.rank}
                    </p:column>

                    <p:column>
                        #{tarrifsParks.getLabelForDurrationTime(tarrif)}
                    </p:column>

                    <p:column>
                        #{tarrif.comments}
                    </p:column>

                </p:subTable>
            </p:dataTable>
        </h:form>

    </ui:define>
</ui:composition>
